5 long long gcd(long long p
, long long q
, long long *x
, long long *y
){
9 if (q
>p
) return(gcd(q
,p
,y
,x
));
15 g
= gcd(q
, p
%q
, &x1
, &y1
);
17 *y
= (x1
- floor(p
/q
)*y1
);
22 long long a
, b
, x
, y
, d
, k
;
23 while (cin
>> a
>> b
){
26 cout
<< x
<< " " << y
<< " " << d
<< endl
;
29 //for (y=1; !found; ++y){
41 //double c = 1.0*(d - b*y)/a;
42 //cout << "c es: " << c << endl;
43 //if (c == floor(c)){ //es entero
50 //cout << x << " " << y << " " << d << endl;
51 //printf("%lld %lld %lld\n", x, y, d);